#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <stdlib.h>

#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"

#define DEBUG 0
#define NOISY_TEST 1

int checkGardensEffect(int currentPlayer, int card, struct gameState *state);

int checkGardensEffect(int currentPlayer, int card, struct gameState *state){

    int handPos = floor(Random() * state->handCount[currentPlayer]);
    int bonus[2] = {0, 1};

    int r = cardEffect(card, 1, 1, 1, state, handPos, bonus);

    assert (r == -1);

    return 0;
}

int main(){

    int i;
    int j;
    int currentPlayer;

    struct gameState g;

    printf ("Testing Gardens Card Effect.\n");

    SelectStream(2);
    PutSeed(3);

    for (j = 0; j < 2000; j++) {
        for (i = 0; i < sizeof(struct gameState); i++) {
            ((char*)&g)[i] = floor(Random() * 256);
        }

        g.whoseTurn = floor(Random() *MAX_PLAYERS);
        currentPlayer = g.whoseTurn;
        g.deckCount[currentPlayer] = floor(Random() * MAX_DECK);
        g.discardCount[currentPlayer] = floor(Random() * MAX_DECK);
        g.handCount[currentPlayer] = floor(Random() * MAX_HAND);
    	g.playedCardCount = floor(Random() * MAX_DECK);

        checkGardensEffect(currentPlayer, gardens, &g);

    }

    printf ("Gardens card OK\n");

    return 0;
}
